import pickle
import  scipy.io as scio
f = open('svm.model', 'rb')
s = f.read()
model = pickle.loads(s)

spamTest = scio.loadmat('spamTest.mat')
xTest = spamTest['Xtest']
yTest = spamTest['ytest']
res = model.predict(xTest)

errCnt = 0
for i in range(0, len(res)):
    if(res[i] != yTest[i]):
        errCnt = errCnt + 1
print("模型识别的准确率为：")
print(1-errCnt/len(res))